<template>
	<view>
		<view>
			<uni-group mode="card">
				<uni-section title="基础样式" type="line" padding>
					<uni-list :border="false">
						<uni-list-item title="修改账号" showArrow link="redirectTo" @click="setPersonalInformation" />
						<uni-list-item title="账号安全" showArrow link="redirectTo" />
						<uni-list-item title="屏蔽管理" showArrow link="redirectTo" />
					</uni-list>
				</uni-section>
			</uni-group>
		</view>
		<view>
			<uni-group mode="card">
				<uni-section title="基础样式" type="line" padding>
					<uni-list :border="false">
						<uni-list-item title="推送管理" showArrow thumb-size="base" />
						<uni-list-item title="缓存管理" showArrow thumb-size="base" />
					</uni-list>
				</uni-section>
			</uni-group>
		</view>
		<view>
			<uni-group mode="card">
				<uni-section title="基础样式" type="line" padding>
					<uni-list :border="false">
						<uni-list-item title="隐私政策" showArrow thumb-size="base" />
						<uni-list-item title="个人信息收集管理" showArrow thumb-size="base" />
						<uni-list-item title="第三方共享清单" showArrow thumb-size="base" />
					</uni-list>
				</uni-section>
			</uni-group>
		</view>
		<view>
			<uni-group mode="card">
				<uni-section title="基础样式" type="line" padding>
					<uni-list :border="false">
						<uni-list-item title="关于我们" showArrow to="hello" link="redirectTo" @click="a" />
					</uni-list>
				</uni-section>
			</uni-group>
		</view>
		<view style="padding: 20rpx;">
			<button v-if="hasLogin" @click="setUp()">
				退出登录
			</button>
			<button v-else @click="setUp()">
				登录
			</button>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		data() {
			return {

			}
		},
		computed: mapState(['hasLogin', 'uerInfo']),
		methods: {
			...mapMutations(['logout']),
			setUp() {
				if (this.uerInfo.userName) {
					this.logout()
				} else {
					uni.navigateTo({
						url: '/pages/onlogin/onlogin'
					})
				}

			},
			setPersonalInformation() {
				//编辑个人信息页面
				uni.navigateTo({
					url: '/pages/ModifyAccount/ModifyAccount'
				})

			},
			a() {
				uni.showToast({
					title:"没事做者玩",
					icon: 'none'
				})
			}
		},
		onLoad() {
			if (this.uerInfo.userName) {
				this.flag = true
			}
		}
	}
</script>

<style>

</style>